package cn.lg.soar.flow.biz.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

/**
 * 模板导出
 *
 * @author luguoxiang
 * @Date: 2025/9/1
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Schema(description = "代办查询")
@Data
public class TodoQuery {

    @Schema(description = "流程名称")
    private String propName;

    @Schema(description = "流程定义id")
    private String processId;

    @Schema(description = "任务名称")
    private String taskName;

    @Schema(description = "任务key")
    private String taskKey;

    @Schema(description = "发起人id")
    private Long startUserId;

    @Schema(description = "流程发起时间-开始")
    private Date procStartTimeMin;
    @Schema(description = "流程发起时间-结束")
    private Date procStartTimeMax;

    @Schema(description = "任务开始时间-开始")
    private Date startTimeMin;
    @Schema(description = "任务开始时间-结束")
    private Date startTimeMax;

    @Schema(description = "任务过期时间-开始")
    private Date dueTimeMin;
    @Schema(description = "任务过期时间-结束")
    private Date dueTimeMax;

    public String getPropNameLike() {
        if (propName == null) {
            return null;
        }
        return '%' + propName + "%";
    }

    public String getTaskNameLike() {
        if (taskName == null) {
            return null;
        }
        return '%' + taskName + "%";
    }

    public String getProcessIdLike() {
        if (processId == null) {
            return null;
        }
        return processId + "%";
    }

}
